package com.ruoyi.testfunction.service.impl;

import java.util.List;
        import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.testfunction.mapper.FunctionTypeMapper;
import com.ruoyi.testfunction.domain.FunctionType;
import com.ruoyi.testfunction.service.IFunctionTypeService;

/**
 * 功能类型Service业务层处理
 *
 * @author LF
 * @date 2024-03-06
 */
@Service
public class FunctionTypeServiceImpl implements IFunctionTypeService {
    @Autowired
    private FunctionTypeMapper functionTypeMapper;

    /**
     * 查询功能类型
     *
     * @param id 功能类型主键
     * @return 功能类型
     */
    @Override
    public FunctionType selectFunctionTypeById(Long id) {
        return functionTypeMapper.selectFunctionTypeById(id);
    }

    /**
     * 查询功能类型列表
     *
     * @param functionType 功能类型
     * @return 功能类型
     */
    @Override
    public List<FunctionType> selectFunctionTypeList(FunctionType functionType) {
        return functionTypeMapper.selectFunctionTypeList(functionType);
    }

    /**
     * 新增功能类型
     *
     * @param functionType 功能类型
     * @return 结果
     */
    @Override
    public int insertFunctionType(FunctionType functionType) {
                functionType.setCreateTime(DateUtils.getNowDate());
            return functionTypeMapper.insertFunctionType(functionType);
    }

    /**
     * 修改功能类型
     *
     * @param functionType 功能类型
     * @return 结果
     */
    @Override
    public int updateFunctionType(FunctionType functionType) {
                functionType.setUpdateTime(DateUtils.getNowDate());
        return functionTypeMapper.updateFunctionType(functionType);
    }

    /**
     * 批量删除功能类型
     *
     * @param ids 需要删除的功能类型主键
     * @return 结果
     */
    @Override
    public int deleteFunctionTypeByIds(Long[] ids) {
        return functionTypeMapper.deleteFunctionTypeByIds(ids);
    }

    /**
     * 删除功能类型信息
     *
     * @param id 功能类型主键
     * @return 结果
     */
    @Override
    public int deleteFunctionTypeById(Long id) {
        return functionTypeMapper.deleteFunctionTypeById(id);
    }
}
